import state from './state'
const mutations ={
    handleToken: (state, token) => {
        state.token = token
        // 把登录的用户的名保存到localStorage中，防止页面刷新，导致vuex重新启动，用户名就成为初始值（初始值为空）的情况
        localStorage.setItem('token', token)
      },
      deleteToken:(state) => {
        state.token = ''
      }
}

export default mutations